<%@ page contentType="text/html; charset=utf-8" 
pageEncoding="utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<jsp:useBean id="b" class="skyinline.j2ee.basic.projectv5.model.BoardVO" />
<jsp:setProperty property="*" name="b" />
<c:set var="b" value="${ bdao.viewBoard(b) }" />

		<style type="text/css">
			.contents { width: 550px; height: 250px;
				display: inline-block; 
				border: 1px solid gold;
				overflow: auto; }
			.dragup { vertical-align: top; }	
		</style>

		<div id="content">
			<h2>게시판 본문</h2>
			<div id="view">
				<div><label>제목</label><span> ${ b.title } </span></div>
				<div><label>작성자</label><span>${ b.uid }</span></div>
				<div><label>작성일</label><span>${ b.wdate } </span></div>
				<div><label>조회수</label><span> ${ b.reades } </span></div>
				<div><label class="dragup">본문</label>
				<span class="contents">${ b.contents }</span></div>
				<div><label> </label><button type="button" id="updbtn">수정하기</button>
					<button type="button" id="delbtn">삭제하기</button> </div>
			</div>
		</div><!-- // content -->
		
		<script type="text/javascript">
			var deletebtn = document.getElementById("delbtn");
			deletebtn.onclick = function () { 
				if ( confirm('정말로 삭제하시겠습니까?') ) {
					location.href="?action=deleteok&bdno=${b.bdno}";                            
				}
			};
			var updatebtn = document.getElementById("updbtn");
			updatebtn.onclick = function() {
				location.href="?action=update&bdno=${b.bdno}";
			};
			
			// 본문 줄바꿈 처리
			var c = document
				.getElementsByClassName("contents");
			//alert( c[0].innerHTML );
			c[0].innerHTML = 
				c[0].innerHTML.replace( 
					new RegExp('\r?\n', 'g'), "<br />" );
			
		</script>
		










